class Solution:
    def waysToBuyPensPencils(self, total: int, cost1: int, cost2: int) -> int:
        res = 0
        while total >= 0:
            res += 1
            if total >= cost2:
                res += total // cost2
            total -= cost1
        return res

if __name__ == '__main__':
    s = Solution()
    print(s.waysToBuyPensPencils(20, 10, 5))
    print(s.waysToBuyPensPencils(5, 10, 10))
